load("//tools:defs.bzl", "go_library")
load("//tools/go_generics:defs.bzl", "go_template_instance")

package(
    default_applicable_licenses = ["//:license"],
    licenses = ["notice"],
)

go_template_instance(
    name = "root_inode_refs",
    out = "root_inode_refs.go",
    package = "mqfs",
    prefix = "rootInode",
    template = "//pkg/refs:refs_template",
    types = {
        "T": "rootInode",
    },
)

go_library(
    name = "mqfs",
    srcs = [
        "mqfs.go",
        "queue.go",
        "registry.go",
        "root.go",
        "root_inode_refs.go",
    ],
    visibility = ["//pkg/sentry:internal"],
    deps = [
        "//pkg/abi/linux",
        "//pkg/atomicbitops",
        "//pkg/context",
        "//pkg/errors/linuxerr",
        "//pkg/refs",
        "//pkg/sentry/fsimpl/kernfs",
        "//pkg/sentry/kernel/auth",
        "//pkg/sentry/kernel/ipc",
        "//pkg/sentry/kernel/mq",
        "//pkg/sentry/vfs",
        "//pkg/usermem",
        "//pkg/waiter",
    ],
)
